Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:13PM |
Registered: 10 years ago Posts: 1,516 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:15PM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:19PM |
Admin Registered: 14 years ago Posts: 19,427 |
e2fsck /dev/sda1
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:19PM |
Registered: 10 years ago Posts: 1,516 |
root@debian:~# e2fsck /dev/sda1 e2fsck 1.42.5 (29-Jul-2012) rootfs contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Error reading block 446 (Attempt to read block from filesystem resulted in short read). Ignore error<y>?
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:19PM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:24PM |
Registered: 10 years ago Posts: 1,516 |
Error reading block 99187 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>? yes Error reading block 99188 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>? yes Error reading block 99189 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>? yes Error reading block 99190 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>? yes Error reading block 99191 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>? yes Error reading block 99192 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>? yes Error reading block 99193 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>? yes Error reading block 99194 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>?
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:26PM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:33PM |
Registered: 10 years ago Posts: 1,516 |
rror reading block 393274 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>? yes Error reading block 393275 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>?
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:36PM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:43PM |
Registered: 10 years ago Posts: 1,516 |
Force rewrite<y>? yes Error reading block 819852 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>?
Error reading block 1081381 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes Force rewrite<y>?
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 09:51PM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 10:26PM |
Registered: 10 years ago Posts: 1,516 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 23, 2017 10:30PM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 24, 2017 12:05AM |
Registered: 10 years ago Posts: 1,516 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 25, 2017 07:30AM |
Registered: 11 years ago Posts: 1,303 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 25, 2017 07:44AM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 25, 2017 01:37PM |
Registered: 10 years ago Posts: 1,516 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 25, 2017 03:49PM |
Registered: 11 years ago Posts: 1,303 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 25, 2017 04:35PM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 25, 2017 07:16PM |
Registered: 11 years ago Posts: 1,303 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 27, 2017 06:32PM |
Registered: 10 years ago Posts: 1,516 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system June 29, 2017 09:44AM |
Registered: 11 years ago Posts: 1,303 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system July 03, 2017 09:10PM |
Registered: 10 years ago Posts: 1,516 |
root@debian:~# dmesg | tail [ 16.685525] udevd[264]: starting version 175 [ 17.072953] input: gpio_keys as /devices/gpio_keys/input/input0 [ 17.486560] orion_wdt: Initial timeout 25 sec [ 19.024266] random: nonblocking pool is initialized [ 19.252235] EXT3-fs (mmcblk0p1): using internal journal [ 21.231881] NET: Registered protocol family 10 [ 24.115523] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 26.784939] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled [ 26.794781] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 37.847036] Adding 1048572k swap on /swapfile1. Priority:-1 extents:979 across:6462620k SSFS root@debian:~# dmesg | tail [ 627.309603] usbcore: registered new interface driver uas [ 628.285043] scsi 1:0:0:0: Direct-Access Generic Mass-Storage 1.11 PQ: 0 ANSI: 2 [ 629.091974] sd 1:0:0:0: [sda] 62521344 512-byte logical blocks: (32.0 GB/29.8 GiB) [ 629.100196] sd 1:0:0:0: [sda] Write Protect is off [ 629.105359] sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00 [ 629.106079] sd 1:0:0:0: [sda] No Caching mode page found [ 629.111395] sd 1:0:0:0: [sda] Assuming drive cache: write through [ 629.124504] sda: sda1 [ 629.130578] sd 1:0:0:0: [sda] Attached SCSI removable disk [ 629.156306] sd 1:0:0:0: Attached scsi generic sg0 type 0 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=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) /dev/sda1 on /media/sda1 type ext3 (rw,noatime,errors=continue,user_xattr,acl,barrier=1,data=ordered) 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 7.2G 2.3G 4.6G 33% /media/sda1 root@debian:~# ls -l /media/sda1 total 1049748 drwxr-xr-x 29 root root 4096 Jun 23 15:51 . 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 Jun 23 19:49 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 5 root users 4096 Jun 23 18:47 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 23 19: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:~# 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 Jun 23 15:51 .. root@debian:~# umount /media/sda1 root@debian:~# fsck.ext3 -pf /dev/sda1 Error reading block 819673 (Attempt to read block from filesystem resulted in short read) while reading inode and block bitmaps. rootfs: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options) root@debian:~# e2fsck /dev/sda1 e2fsck 1.42.5 (29-Jul-2012) rootfs: clean, 68599/490560 files, 652386/1938176 blocks root@debian:~#
Re: Migrating Debian rootfs from Ext3 to Ext4 file system July 03, 2017 10:47PM |
Admin Registered: 14 years ago Posts: 19,427 |
Quote
https://debian-administration.org/article/643/Migrating_a_live_system_from_ext3_to_ext4_filesystem
Converting a non-root filesystem to ext4
As long as you are converting a filesystem that can be unmounted, it is fairly simple procedure. In this example we will be converting a /dev/sdc1 partition mounted as /home directory.
First, unmount the partition.
umount /dev/sdc1
Next, run a filesystem check on it to make sure it is in sane condition. We are still on ext3.
fsck.ext3 -pf /dev/sdc1
Enable new features of ext4 on the filesystem.
tune2fs -O extents,uninit_bg,dir_index /dev/sdc1
Option "extents" enables the filesystem to use extents instead of bitmap mapping for files, "uninit_bg" reduces file system check times by only checking used portions of the disk, and "dir_index" allows storing the contents of large directories in a htree for faster access. Option "dir_index" is also supported by ext3, so you may already be using it, but it makes no harm to specify it here.
Run a filesystem check. It will find errors. It is normal. Let it fix them. You may want to run the check twice to make sure that the filesystem is now clean.
fsck.ext4 -yfD /dev/sdc1
The "-D" parameter will actually enable the "dir_index" option by rebuilding directory index. It can be rebuilt (optimized) at any later time by running the check with the parameter.
Now edit your /etc/fstab file to say "ext4" instead of "ext3" for /home. Other options may differ for your system.
/dev/sdc1 /home ext4 defaults 0 2
Try to mount your new ext4 filesystem.
mount /home
If it succeeds, congratulations. If not, do not panic. You have not lost your data. And you have a backup after all, right? Make sure you have all the latest tools listed in prerequisites. Get them form Debian unstable or experimental if needed. Upgrade and try again.
tune2fs -O extents,uninit_bg,dir_index /dev/sda1
e2fsck /dev/sdc1and then run it again the 2nd time:
e2fsck /dev/sdc1
Re: Migrating Debian rootfs from Ext3 to Ext4 file system July 03, 2017 11:34PM |
Registered: 10 years ago Posts: 1,516 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system July 03, 2017 11:40PM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system July 03, 2017 11:43PM |
Admin Registered: 14 years ago Posts: 19,427 |
mkdir -p /media/sda1 mount -o noatime /dev/sda1 /media/sda1
mount
Re: Migrating Debian rootfs from Ext3 to Ext4 file system July 04, 2017 01:10AM |
Registered: 10 years ago Posts: 1,516 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system July 09, 2017 03:44AM |
Admin Registered: 14 years ago Posts: 19,427 |
Re: Migrating Debian rootfs from Ext3 to Ext4 file system July 09, 2017 11:10PM |
Registered: 10 years ago Posts: 1,516 |