Welcome! Log In Create A New Profile

Advanced

Migrating Debian rootfs from Ext3 to Ext4 file system

Posted by JoeyPogoPlugE02 
Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 07:25PM
We start with a Pogoplug 4 Mobile, with an Ext3 OS on SD card and copied to another SD card which through an adapter goes into the USB slot.

And now, heeeer's bodhi to light the way...

=========
-= Cloud 9 =-



Edited 1 time(s). Last edit at 06/23/2017 07:26PM by JoeyPogoPlugE02.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 07:38PM
TBD.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 3 time(s). Last edit at 06/23/2017 08:52PM by bodhi.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 07:39PM
Joey,

Go ahead and start each step and I'll update the post above as we go. At each step, post the log of that step.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 06/23/2017 07:40PM by bodhi.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 07:46PM
2. Insert the Ext3 rootfs. Check the driver letter 

dmesg | tail

root@debian:~# dmesg | tail
[   16.635075] udevd[267]: starting version 175
[   17.008015] input: gpio_keys as /devices/gpio_keys/input/input0
[   17.464454] orion_wdt: Initial timeout 25 sec
[   19.078763] EXT3-fs (mmcblk0p1): using internal journal
[   19.401288] random: nonblocking pool is initialized
[   21.641282] NET: Registered protocol family 10
[   24.375198] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   27.198041] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   27.207885] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   34.129823] Adding 1048572k swap on /swapfile1.  Priority:-1 extents:979 across:6462620k SSFS
root@debian:~#



3. Insert the Ext4 drive. Check the driver letter 

dmesg | tail

I assume you mean the cloned stick, so here goes:

root@debian:~# dmesg | tail
[  604.890117] usbcore: registered new interface driver uas
[  605.875000] scsi 1:0:0:0: Direct-Access     Generic  Mass-Storage     1.11 PQ: 0 ANSI: 2
[  606.671181] sd 1:0:0:0: [sda] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[  606.679531] sd 1:0:0:0: [sda] Write Protect is off
[  606.684674] sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00
[  606.685410] sd 1:0:0:0: [sda] No Caching mode page found
[  606.690724] sd 1:0:0:0: [sda] Assuming drive cache: write through
[  606.706087]  sda: sda1
[  606.712037] sd 1:0:0:0: [sda] Attached SCSI removable disk
[  606.735029] sd 1:0:0:0: Attached scsi generic sg0 type 0
root@debian:~#


4. If your Debian has automount set up, the drives were already mounted at this point. Check: 

mount

root@debian:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=14436,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=12172k,mode=755)
/dev/mmcblk0p1 on / type ext3 (rw,noatime,errors=remount-ro,user_xattr,acl,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=24340k)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
root@debian:~#


5. Mount the drives, if they were not auto-mounted: 

mkdir -p /media/sdb1 
mount -o noatime /media/sdb1 /dev/sdb1

mkdir -p /media/sdc1
mount -o noatime /media/sdc1 /dev/sdc1

Then, verify they were mounted 

mount

root@debian:~# mkdir -p /media/sdb1
root@debian:~# mount -o noatime /media/sdb1 /dev/sdb1
mount: mount point /dev/sdb1 does not exist
root@debian:~# mkdir -p /media/sdc1
root@debian:~# mount -o noatime /media/sdc1 /dev/sdc1
mount: mount point /dev/sdc1 does not exist
root@debian:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=14436,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=12172k,mode=755)
/dev/mmcblk0p1 on / type ext3 (rw,noatime,errors=remount-ro,user_xattr,acl,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=24340k)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
root@debian:~#

I'll double check, no you will lol

=========
-= Cloud 9 =-



Edited 4 time(s). Last edit at 06/23/2017 08:02PM by JoeyPogoPlugE02.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 07:56PM
OK so go ahead step 4. step 5 needs revision.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 06/23/2017 07:57PM by bodhi.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:00PM
Which one is the clone of the rootfs, and which one is the new drive?

Is the SD card the clone rootfs? or the USB drive?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 06/23/2017 08:02PM by bodhi.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:05PM
bodhi Wrote:
-------------------------------------------------------
> Which one is the clone of the rootfs, and which on
> e is the new drive?
>
> Is the SD card the clone rootfs? or the USB drive?

I think the SD card is the cloned one. But whatever updates, it can be cloned once again away from the Pogoplug

=========
-= Cloud 9 =-
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:09PM
I think I was not clear.

How many drives are there in the system right now? The SD card is the live rootfs, it does not count.

To do copy we need 2 more drives, one with the clone, one with nothing in it.

Or do you want to upgrade the live rootfs, which is the SD card right now.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:10PM
OK. I see. You are booting the Mobile with the SD card, which was cloned :) correct?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:12PM
bodhi Wrote:
-------------------------------------------------------
>
> Or do you want to upgrade the live rootfs, which i
> s the SD card right now.

Yeah that makes more sense. I'll simplify:

For reference, a Pogoplug 4 Mobile has two slots, an SD slot and a USB slot.

Right now I have two cards plugged in.

It booted from the SD card/slot, and a clone was later inserted to the USB slot via microSD > USB adapter.

To me it doesn't matter which is converted because the Ext4 one will be cloned back over the old Ext3.

=========
-= Cloud 9 =-



Edited 2 time(s). Last edit at 06/23/2017 08:25PM by JoeyPogoPlugE02.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:25PM
Ok then, I have to rewrite the instruction..

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 06/23/2017 08:26PM by bodhi.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:26PM
Ok Joey,

We are going do this to the live rootfs. So unplug the adapter.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:28PM
Bodhi that't exactly what I already did. However one card is Samsung EVO and the other Sandisk.

If you're sure about that, I can delete one card and clone again.


bodhi Wrote:
-------------------------------------------------------
> Ok Joey,
>
> We are going do this to the live rootfs. So unplug
> the adapter.

Okay, USB unplugged, reboot SD card.. hold on...

=========
-= Cloud 9 =-



Edited 1 time(s). Last edit at 06/23/2017 08:35PM by JoeyPogoPlugE02.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:37PM
JoeyPogoPlugE02 Wrote:
-------------------------------------------------------
> Bodhi that't exactly what I already did. However o
> ne card is Samsung EVO and the other Sandisk.
>
> If you're sure about that, I can delete one card a
> nd clone again.

:) I think I've confused you.

Let's do this the easy way and save some time.

You need to have 2 clones: Now you are using one to boot, and the 2nd one is going to be upgrade to Ext4 (your second one) will in in the USB adapter.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:39PM
bodhi Wrote:
-------------------------------------------------------

> You need to have 2 clones: Now you are using one t
> o boot, and the 2nd one is going to be upgrade to
> Ext4 (your second one) will in in the USB adapter.


heck yeah, it's rebooted and one of those two clones are in the SD slot, because that's what It booted from :-)
The other clone is on the table, in the USB adapter, far away from Pogoplug.

=========
-= Cloud 9 =-
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:40PM
Now insert the 2nd clone in, and check the drive letter:

dmesg | tail

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 06/23/2017 08:42PM by bodhi.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:43PM
bodhi Wrote:
-------------------------------------------------------
> Now insert the 2nd clone in, and check the drive l
> etter:
>
>
> dmesg | tail
>


root@debian:~# dmesg | tail
[  330.261041] scsi host2: usb-storage 1-1:1.0
[  331.265037] scsi 2:0:0:0: Direct-Access     Generic  Mass-Storage     1.11 PQ: 0 ANSI: 2
[  331.285131] sd 2:0:0:0: Attached scsi generic sg0 type 0
[  332.023469] sd 2:0:0:0: [sda] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[  332.031692] sd 2:0:0:0: [sda] Write Protect is off
[  332.036848] sd 2:0:0:0: [sda] Mode Sense: 03 00 00 00
[  332.037571] sd 2:0:0:0: [sda] No Caching mode page found
[  332.042880] sd 2:0:0:0: [sda] Assuming drive cache: write through
[  332.058750]  sda: sda1
[  332.071099] sd 2:0:0:0: [sda] Attached SCSI removable disk
root@debian:~#

Curious, where do you see the drive letter in there?

=========
-= Cloud 9 =-



Edited 1 time(s). Last edit at 06/23/2017 08:49PM by JoeyPogoPlugE02.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:49PM
Mount the drive

mkdir -p /media/sda1
mount -o noatime /dev/sda1 /media/sda1
and check the mount

mount

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 06/23/2017 08:49PM by bodhi.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:50PM
bodhi Wrote:
-------------------------------------------------------
> Mount the drive
>
>
> mkdir -p /media/sda1
> mount -o noatime /dev/sda1 /media/sda1
>
> and check the mount
>
>
> mount
>


root@debian:~# mkdir -p /media/sda1
root@debian:~# mount -o noatime /dev/sda1 /media/sda1
root@debian:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=14436,mode=7
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,pe=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=12172k,mode=755)
/dev/mmcblk0p1 on / type ext3 (rw,noatime,errors=remount-ro,user_xattr,acler=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=24340k)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
/dev/sda1 on /media/sda1 type ext3 (rw,noatime,errors=continue,user_xattr,rrier=1,data=ordered)
root@debian:~#

(I'm listening to Tedeschi Trucks Band. They're really have a great vibe, a little of everything. That's why they charge $100 a ticket general admission)

=========
-= Cloud 9 =-



Edited 1 time(s). Last edit at 06/23/2017 08:54PM by JoeyPogoPlugE02.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:51PM
Cool!

so it was mounted

Quote

/dev/sda1 on /media/sda1 type ext3 (rw,noatime,errors=continue,user_xattr,rrier=1,data=ordered)

Now check capacity and briefly list the top folder files

df -h
ls -l /media/sda1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:55PM
bodhi Wrote:
-------------------------------------------------------
> Cool!
>
> so it was mounted
>
>
Quote

/dev/sda1 on /media/sda1 type ext3 (rw,noat
> ime,errors=continue,user_xattr,rrier=1,data=ordere
> d)
>
> Now check capacity and briefly list the top folder
> files
>
>
> df -h
> ls -l /media/sda1
>


root@debian:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           15G  2.3G   12G  17% /
udev             10M     0   10M   0% /dev
tmpfs            12M  244K   12M   3% /run
/dev/mmcblk0p1   15G  2.3G   12G  17% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            24M     0   24M   0% /run/shm
/dev/sda1        15G  2.3G   12G  17% /media/sda1
root@debian:~# ls -l /media/sda1
total 1049748
drwxr-xr-x 29 root root             4096 Jan 13  2016 .
drwxrwxrwx  5 root users            4096 Jun 23 18:47 ..
drwxr-xr-x  4 root root             4096 Jan 12  2016 .cedata
-rw-r--r--  1 root root               30 Jan 12  2016 .ceid
drwxrwxrwx  2 root root             4096 Dec 31  1969 .vnc
drwxr-xr-x  2 root root             4096 Jun 14 22:40 bin
drwxr-xr-x  3 root root             4096 Jan 13  2016 boot
drwxr-xr-x  2 root root             4096 Dec 31  1969 dev
drwxr-xr-x 75 root root             4096 Dec 31  1969 etc
drwxr-xr-x  8 root root             4096 Oct 23  2015 files_to_upload
drwxrwxrwx  4 root sambashare       4096 Aug 19  2015 home
drwxrwxrwx  2 root root             4096 Feb 25  2015 installation
drwxr-xr-x 11 root root             4096 Jun 14 22:38 lib
drwx------  2 root root            16384 Mar 25  2015 lost+found
drwxrwxrwx  2 root users            4096 Jan 14  2016 media
drwxrwxrwx  4 root root             4096 Sep 10  2015 mnt
drwxr-xr-x  2 root root             4096 Feb 24  2012 opt
dr-xr-xr-x  2 root root             4096 Dec 31  1969 proc
drwx------ 14 root root             4096 Jun 14 23:09 root
drwxr-xr-x  2 root root             4096 Dec 31  1969 run
drwxr-xr-x  2 root root             4096 Jun 14 22:41 sbin
drwxr-xr-x  2 root root             4096 Aug 12  2015 sdb
drwxr-xr-x  3 root root             4096 Aug 12  2015 sdb5
drwxr-xr-x  2 root root             4096 Jul 21  2010 selinux
drwxrwxrwx  3 root users            4096 Feb 21  2016 share
drwxr-xr-x  2 root root             4096 Feb 24  2012 srv
-rw-------  1 root root       1073741824 Jan 13  2016 swapfile1
dr-xr-xr-x  2 root root             4096 Dec 31  1969 sys
drwxrwxrwt  5 root root             4096 Jun 14 23:17 tmp
drwxr-xr-x 10 root root             4096 Feb 24  2012 usr
drwxr-xr-x 12 root root             4096 Feb 25  2015 var
-rw-r--r--  1 root root             9537 Jun 14 21:53 webmin-setup.out
root@debian:~#

=========
-= Cloud 9 =-
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:56PM
And see the files in boot to make sure the kernel files are there.

ls -latr /media/sda1/boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 08:59PM
bodhi Wrote:
-------------------------------------------------------
> And see the files in boot to make sure the kernel
> files are there.
>
>
> ls -latr /media/sda1/boot
>


root@debian:~# ls -latr /media/sda1/boot
total 30688
-rw-r--r--  1 root root   10228 Oct  9  2014 kirkwood-pogo_e02.dtb
drwxr-xr-x  2 root root    4096 Oct 17  2014 dts
-rwxr-xr-x  1 root root 2822168 Oct 22  2014 zImage-3.17.0-kirkwood-tld-1
-rwxr-xr-x  1 root root 2822168 Oct 22  2014 vmlinuz-3.17.0-kirkwood-tld-1
-rw-r--r--  1 root root  129088 Oct 22  2014 config-3.17.0-kirkwood-tld-1
-rw-r--r--  1 root root 1991026 Oct 22  2014 System.map-3.17.0-kirkwood-tld-1
-rw-r--r--  1 root root 6114271 Oct 24  2014 initrd.img-3.17.0-kirkwood-tld-1
-rw-r--r--  1 root root 2822232 Oct 24  2014 uImage.orig
-rw-r--r--  1 root root 6114335 Oct 24  2014 uInitrd
-rw-r--r--  1 root root 2832460 Feb 23  2015 uImage.Pogo_E02
-rwxrwxrwx  1 1000 1000    2586 Feb 24  2015 uboot.2014.07-tld-1.environment.scr
drwxr-xr-x  3 root root    4096 Jan 13  2016 .
-rwxr-xr-x  1 root root 2832196 Jan 13  2016 zImage.fdt
-rw-r--r--  1 root root 2832260 Jan 13  2016 uImage
drwxr-xr-x 29 root root    4096 Jan 13  2016 ..
root@debian:~#

It's humble beginnings from the E02 are conspicuous yet evoke good memories :-)

=========
-= Cloud 9 =-



Edited 1 time(s). Last edit at 06/23/2017 09:00PM by JoeyPogoPlugE02.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 09:00PM
Unmount the drive and check for error

umount /media/sda1
fsck.ext3 -pf /dev/sda1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 06/23/2017 09:01PM by bodhi.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 09:01PM
bodhi Wrote:
-------------------------------------------------------
> Unmount the drive and check for error
>
>
> umount /media/sda1
> fsck.ext3 -pf /dev/sda1
>

root@debian:~# umount /dev/sda1
root@debian:~# fsck.ext3 -pf /dev/sda1
rootfs: Inodes that were part of a corrupted orphan linked list found.

rootfs: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
root@debian:~#

this is a learning moment...

Should I go with
fsck.ext3 -f /dev/sda1

root@debian:~# fsck.ext3 -f /dev/sda1
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found.  Fix<y>?

Here's where it sits, should I hit Y?

=========
-= Cloud 9 =-



Edited 4 time(s). Last edit at 06/23/2017 09:05PM by JoeyPogoPlugE02.
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 09:05PM
> this is a learning moment...

Yes, it means your rootfs has file system errors (probably benign because you are still booting with this). And now we are fixing it before converting.

Check again and say yes to each question.

e2fsck /dev/sda1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 09:10PM
I'm holding Y down and it might be a long one...

=========
-= Cloud 9 =-
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 09:10PM
Joey, don't update your post. Just make a new one.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 09:11PM
Press Ctrl-C to abort.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Migrating Debian rootfs from Ext3 to Ext4 file system
June 23, 2017 09:12PM
bodhi Wrote:
-------------------------------------------------------
> Press Ctrl-C to abort.

Bodhi I'm using your exact code now, with no -f in it. One sec

=========
-= Cloud 9 =-
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: